package com.team11.server.controller.teacher;


import com.team11.server.pojo.dto.RespBean;
import com.team11.server.pojo.dto.RespPageBean;
import com.team11.server.service.IGScoreService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.CrossOrigin;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author pjc
 * @since 2021-07-08
 */
@CrossOrigin
@RestController
@RequestMapping("/teacher")
@Api(tags = "教师接口")
public class TeacherGScoreController {

    @Resource
    private IGScoreService igScoreService;

    @ApiOperation("综合评分-->小组评分：获取小组评分页面（分页）")
    @PostMapping("/getGroupScoreList")
    public RespPageBean getGroupScoreList(@RequestParam(defaultValue = "1") Integer current,
                                          @RequestParam(defaultValue = "10") Integer size,
                                          String pName, String kcName
    ) {
        return igScoreService.getGroupScoreList(current,size,pName,kcName);
    }

    @ApiOperation("综合评分-->小组评分：获取小组综合评分详情+小组作业")
    @PostMapping("/getGScoreDetails")
    public RespPageBean getGScoreDetails(@RequestParam(defaultValue = "1") Integer current,
                                         @RequestParam(defaultValue = "10") Integer size,
                                         @RequestParam("gId") Integer gId,
                                         @RequestParam("type") Integer type
                                            ){
        return igScoreService.getGScoreDetails(current,size,gId,type);
    }

    @ApiOperation("综合评分-->小组评分：老师对小组进行综合打分")
    @PostMapping("/GroupComprehensiveScore")
    public RespBean GroupComprehensiveScore(@RequestParam("g_id") Integer gId,
                                            @RequestParam("tJobNumber") String tJobNumber, @RequestParam("tId") Integer tId,
                                            @RequestParam("gScore") String gScore, @RequestParam("gContent") String gContent) {
        return igScoreService.GroupComprehensiveScore(gId,tJobNumber, tId, gScore, gContent);
    }
}
